<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <h1 class="time"></h1>
    <script>
        var oDiv = document.querySelector('.time');
        oDiv.innerHTML = fn();
        setInterval(function () {
            oDiv.innerHTML = fn();
        }, 1000)
        function fn() {
            var date = new Date();
            var date2 = new Date('2022,12,31');
            var date3 = date2 - date;
            var hao = date3 / 1000;
            var tian = parseInt(hao / 3600 / 24);
            var xiaoShi = parseInt(hao / 3600 % 24);
            var fen = parseInt(hao / 60 % 60);
            var miao = parseInt(hao % 60)
            return `julidanfangjia${tian}tian${xiaoShi}xiaoshi${fen}fen${miao}miao`
        }
        console.log(fn())

    </script>
</body>

</html>